package com.lsx.logisticscore.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lsx.logisticscore.entity.Log;
import com.lsx.logisticscore.mapper.LogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogService {
    @Autowired
    private LogMapper logMapper;

    public int deleteLog(Integer ticketId){
        QueryWrapper<Log> wrapper = new QueryWrapper<>();
        wrapper.eq("ticket_id", ticketId);
        return logMapper.delete(wrapper);
    }
    //状态流转 待处理-等待发车-运输中-已抵达-完成
    public int addLog(Log log){
        return logMapper.insert(log);
    }
}
